home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 43 / Amiga Format CD43 (1999)(Future Publishing)(GB)(Track 1 of 2)[!][issue 1999-09].iso / -serious- / comms / other / ums / developer / oberon / ums.mod
Text File  |  1999-06-14  |  26KB  |  629 lines

  1. MODULE ums;
  2.  
  3. IMPORT Alert, Utility, Dos, Exec, Intuition, SYSTEM;
  4.  
  5. CONST
  6.   libName*    = "ums.library";
  7.   libVersion* = 11;
  8.  
  9. VAR
  10.   base*  : Exec.LibraryPtr;
  11.  
  12. TYPE
  13.   Account*  = LONGINT;
  14.   MsgNum*   = LONGINT;
  15.   Error*    = INTEGER;
  16.  
  17. CONST
  18.   NumFields*    = 128;
  19.  
  20. TYPE
  21.   APTR*         = Exec.APTR;
  22.   STRPTR*       = Exec.LSTRPTR;
  23.  
  24.   MsgTextFields* = ARRAY NumFields OF STRPTR;
  25.  
  26.   MessageInfo*  = STRUCT
  27.                     hdrLen-     : LONGINT;
  28.                     txtLen-     : LONGINT;
  29.                     date-       : LONGINT;
  30.                     up-, dn-,
  31.                     lt-, rt-    : MsgNum;
  32.                     globalStat- : LONGSET;
  33.                     userStat-   : LONGSET;
  34.                     loginStat-  : LONGSET;
  35.                     hardLink-   : MsgNum;
  36.                     softLink-   : MsgNum;
  37.                     (* V11 extension, only filled by tagRExtMsgInfo *)
  38.                     cDate-      : LONGINT;
  39.                     reserved    : ARRAY 3 OF LONGINT;
  40.                   END;
  41.  
  42. CONST
  43.    (* actions for ServerControl() *)
  44.  
  45.    CleanUp*   = 1;
  46.    Flush*     = 2;
  47.    Quit*      = 3;
  48.    QuitForce* = 4;
  49.    Ping*      = 5;
  50.    LockCfg*   = 6;
  51.    UnlockCfg* = 7;
  52.  
  53.    (* enumeration of fields in an UMS-message *)
  54.  
  55.    msgText*         =   0;
  56.    fromName*        =   1;
  57.    fromAddr*        =   2;
  58.    toName*          =   3;
  59.    toAddr*          =   4;
  60.    msgID*           =   5;
  61.    creationDate*    =   6;
  62.    receiveDate*     =   7;
  63.    refID*           =   8;
  64.    group*           =   9;
  65.    subject*         =  10;
  66.    attributes*      =  11;
  67.    comments*        =  12;
  68.    organization*    =  13;
  69.    distribution*    =  14;
  70.    folder*          =  15;
  71.    fidoID*          =  16;
  72.    mausID*          =  17;
  73.    replyGroup*      =  18;
  74.    replyName*       =  19;
  75.    replyAddr*       =  20;
  76.    logicalToName*   =  21;
  77.    logicalToAddr*   =  22;
  78.    fileName*        =  23;
  79.    rfcMsgNum*       =  24;
  80.  
  81.    fidoText*        =  32;
  82.    errorText*       =  33;
  83.    newsreader*      =  34;
  84.    rfcAttr*         =  35;
  85.    ftnAttr*         =  36;
  86.    zerAttr*         =  37;
  87.    mausAttr*        =  38;
  88.  
  89.    tempFileName*    = 127;
  90.  
  91.   (* user status-bits *)
  92.  
  93.   archive*    =  4; (* msg should be archived, don't delete *)
  94.   junk*       =  5; (* negative selection, inheritance suggested *)
  95.   postPoned*  =  6; (* to be read again, (but not now) *)
  96.   selected*   =  7; (* positive selection, inheritance suggested *)
  97.   filtered*   = 15; (* msg has been processed by filter,
  98.                        'selected' and 'junk' have been properly set *)
  99.  
  100.   Old*          =  8; (* user has already read this Message *)
  101.   Read*         =  Old;
  102.   WriteAccess*  =  9; (* user may change or delete this message *)
  103.   ReadAccess*   = 10; (* user may read this message *)
  104.   ViewAccess*   = 11; (* user may read the header of this message *)
  105.   Owner*        = 12; (* user 'owns' (wrote) this message *)
  106.  
  107.   ProtectedUserFlags*= {WriteAccess, ReadAccess, ViewAccess, Owner};
  108.  
  109.   (* global status-bits *)
  110.  
  111.   Deleted*      = 0; (* msg is really deleted *)
  112.   Expired*      = 1; (* msg has expired and may be deleted *)
  113.   Exported*     = 2; (* msg has been exported *)
  114.   Orphan*       = 3; (* msg could not be exported *)
  115.   Link*         = 4; (* within a ring of linked msgs *)
  116.   HardLink*     = 5; (* link is hardLink *)
  117.   Parked*       = 6; (* msg is "parked", i.e. must not (yet) be exported *)
  118.   HasFile*      = 7; (* msg has an attached file (tempFilename) *)
  119.  
  120.   ProtectedGlobalFlags*= {Deleted, Exported, Orphan, Link, HardLink, HasFile};
  121.  
  122. (*** Errors** *)
  123.  
  124. CONST
  125.   ok*               =  0;
  126.   unknown*          =  1;
  127.  
  128.   noSubject*        = 100;
  129.   forbiddenCode*    = 101;
  130.   noWriteAccess*    = 102;
  131.   noReader*         = 103;
  132.   noExporter*       = 104;
  133.   badLink*          = 105;
  134.   noWork*           = 106;
  135.   noSysop*          = 107;
  136.   badChange*        = 108;
  137.   groupForm*        = 109;
  138.   tooBig*           = 110;
  139.   notRunning*       = 111;
  140.   noImportAcc*      = 112;
  141.   noFromName*       = 113;
  142.   noToName*         = 114;
  143.   cfgLocked*        = 115;
  144.   noHardlinks*      = 116;
  145.  
  146.   dupe*             = 200;
  147.   noReadAccess*     = 201;
  148.   noViewAccess*     = 202;
  149.   msgCorrupted*     = 203;
  150.   noHdrSpace*       = 204;
  151.   noSuchMsg*        = 205;
  152.   badName*          = 206;
  153.   badTag*           = 207;
  154.   missingTag*       = 208;
  155.   noSuchUser*       = 209;
  156.   notFound*         = 210;
  157.   autoBounce*       = 211;
  158.   msgDeleted*       = 212;
  159.   noNetAccess*      = 213;
  160.   badPattern*       = 214;
  161.   badVarname*       = 215;
  162.   fsFull*           = 216;
  163.   noMsgMem*         = 217;
  164.   missingIndex*     = 218;
  165.   mxTags*           = 219;
  166.   userExists*       = 220;
  167.   noSuchAlias*      = 221;
  168.   suicide*          = 222;
  169.   exeErr*           = 223;
  170.  
  171.   serverTerminated* = 300;
  172.   cantWrite*        = 301;
  173.   cantRead*         = 302;
  174.   wrongMsgPtr*      = 303;
  175.   serverNotFree*    = 304;
  176.   idCountProb*      = 305;
  177.   noLogin*          = 306;
  178.   wrongServer*      = 307;
  179.   noMem*            = 308;
  180.   wrongTask*        = 309;
  181.  
  182.   tcpError*         = 400;
  183.  
  184.   (* tag-values *)
  185.  
  186.   typeSTRPTR    = 2000H;
  187.   typeVARPAR    = 4000H;
  188.  
  189.  
  190.   (** tags for WriteMsg()* *)
  191.  
  192.   (*  add 'typeVARPAR' for ReadMsg()  *)
  193.   (*  no 'typeVARPAR' for WriteMsg()  *)
  194.  
  195.   tagMsgNum*            =  1 + Utility.user;
  196.  
  197.   tagMsgDate*           =  4 + Utility.user;
  198.                                 (* don't usually use when writing!      *)
  199.                                 (* Using tagMsgDate with WriteMsg()     *)
  200.                                 (* has a very special meaning.          *)
  201.   tagChainUp*           =  7 + Utility.user;
  202.   tagHardLink*          = 14 + Utility.user;
  203.   tagSoftLink*          = 15 + Utility.user;
  204.   tagMsgCDate*          = 16 + Utility.user;
  205.  
  206.   tagAutoBounce*        = 65 + Utility.user;
  207.                                 (* when writing:                                *)
  208.                                 (* data # 0: server returns error 'autoBounce', *)
  209.                                 (*           but still keeps the Msg and sends  *)
  210.                                 (*           it to the sysops.                  *)
  211.   tagHdrFill*           = 66 + Utility.user;
  212.                                 (* when writing: how much bytes to be reserved  *)
  213.   tagTxtFill*           = 67 + Utility.user;
  214.                                 (*               for header and text            *)
  215.   tagNoUpdate*          = 69 + Utility.user;
  216.                                 (* data = 0: (default) set 'Old'-Flag when      *)
  217.                                 (*           reading or writing                 *)
  218.                                 (* data = 1: don't touch 'Old'-Flag        *)
  219.   tagHide*              = 70 + Utility.user;
  220.                                 (* for writing:                                 *)
  221.                                 (* data = 0: default                            *)
  222.                                 (* data = 1: msg only accessible by exporters   *)
  223.                                 (* data = 2: msg only accessible by users       *)
  224.   tagCheckHeader*       = 71 + Utility.user;
  225.                                 (* data = 0: default                            *)
  226.                                 (* data = 1: don't write msg, only check access    *)
  227.  
  228.   tagMsgText*           = 256 + typeSTRPTR + Utility.user;
  229.   tagFromName*          = tagMsgText + fromName;
  230.   tagFromAddr*          = tagMsgText + fromAddr;
  231.   tagToName*            = tagMsgText + toName;
  232.   tagToAddr*            = tagMsgText + toAddr;
  233.   tagMsgID*             = tagMsgText + msgID;
  234.   tagCreationDate*      = tagMsgText + creationDate;
  235.   tagReceiveDate*       = tagMsgText + receiveDate;
  236.   tagRefID*             = tagMsgText + refID;
  237.   tagGroup*             = tagMsgText + group;
  238.   tagSubject*           = tagMsgText + subject;
  239.   tagAttributes*        = tagMsgText + attributes;
  240.   tagComments*          = tagMsgText + comments;
  241.   tagOrganization*      = tagMsgText + organization;
  242.   tagDistribution*      = tagMsgText + distribution;
  243.   tagFolder*            = tagMsgText + folder;
  244.   tagFidoID*            = tagMsgText + fidoID;
  245.   tagMausID*            = tagMsgText + mausID;
  246.   tagReplyGroup*        = tagMsgText + replyGroup;
  247.   tagReplyName*         = tagMsgText + replyName;
  248.   tagReplyAddr*         = tagMsgText + replyAddr;
  249.   tagLogicalToName*     = tagMsgText + logicalToName;
  250.   tagLogicalToAddr*     = tagMsgText + logicalToAddr;
  251.   tagFileName*          = tagMsgText + fileName;
  252.   tagRFCMsgNum*         = tagMsgText + rfcMsgNum;
  253.  
  254.   tagFidoText*          = tagMsgText + fidoText;
  255.   tagErrorText*         = tagMsgText + errorText;
  256.   tagNewsreader*        = tagMsgText + newsreader;
  257.  
  258.   tagRfcAttr*           = tagMsgText + rfcAttr;
  259.   tagFtnAttr*           = tagMsgText + ftnAttr;
  260.   tagZerAttr*           = tagMsgText + zerAttr;
  261.   tagMausAttr*          = tagMsgText + mausAttr;
  262.  
  263.   tagTempFileName*      = tagMsgText + tempFileName;
  264.  
  265.   tagTextFields*        = 513 + Utility.user;
  266.                                 (* datatype: POINTER TO MsgTextFields *)
  267.  
  268.  
  269.   (** tags for ReadMsg()* *)
  270.  
  271.   (*  add 'typeVARPAR' for ReadMsg()  *)
  272.   (*  no 'typeVARPAR' for WriteMsg()  *)
  273.  
  274.   tagRMsgNum*           =  1 + Utility.user;
  275.  
  276.   tagRHdrLength*        =  2 + Utility.user + typeVARPAR;
  277.   tagRTxtLength*        =  3 + Utility.user + typeVARPAR;
  278.   tagRMsgDate*          =  4 + Utility.user + typeVARPAR;
  279.   tagRChainUp*          =  7 + Utility.user + typeVARPAR;
  280.   tagRChainDn*          =  8 + Utility.user + typeVARPAR;
  281.   tagRChainLt*          =  9 + Utility.user + typeVARPAR;
  282.   tagRChainRt*          = 10 + Utility.user + typeVARPAR;
  283.   tagRGlobalFlags*      = 11 + Utility.user + typeVARPAR;
  284.   tagRUserFlags*        = 12 + Utility.user + typeVARPAR;
  285.   tagRLoginFlags*       = 13 + Utility.user + typeVARPAR;
  286.   tagRHardLink*         = 14 + Utility.user + typeVARPAR;
  287.   tagRSoftLink*         = 15 + Utility.user + typeVARPAR;
  288.   tagRMsgCDate*         = 16 + Utility.user + typeVARPAR;
  289.  
  290.   tagRDateStyle*        = 64 + Utility.user;
  291.                                 (* style for receiveDate when reading:          *)
  292.                                 (* data = 0: no receiveDate                     *)
  293.                                 (* data = 1: emulate old-style receiveDate      *)
  294.   tagRIDStyle*          = 68 + Utility.user;
  295.                                 (* style for Message-ID                         *)
  296.                                 (* data = 0: real Message-ID                    *)
  297.                                 (* data = 1: old style dec-number               *)
  298.   tagRNoUpdate*         = 69 + Utility.user;
  299.                                 (* data = 0: (default) set 'Old'-Flag when      *)
  300.                                 (*           reading or writing                 *)
  301.                                 (* data = 1: don't touch 'Old'-Flag        *)
  302.  
  303.   tagRMsgText*          = 256 + typeSTRPTR + typeVARPAR + Utility.user;
  304.   tagRFromName*         = tagRMsgText + fromName;
  305.   tagRFromAddr*         = tagRMsgText + fromAddr;
  306.   tagRToName*           = tagRMsgText + toName;
  307.   tagRToAddr*           = tagRMsgText + toAddr;
  308.   tagRMsgID*            = tagRMsgText + msgID;
  309.   tagRCreationDate*     = tagRMsgText + creationDate;
  310.   tagRReceiveDate*      = tagRMsgText + receiveDate;
  311.   tagRRefID*            = tagRMsgText + refID;
  312.   tagRGroup*            = tagRMsgText + group;
  313.   tagRSubject*          = tagRMsgText + subject;
  314.   tagRAttributes*       = tagRMsgText + attributes;
  315.   tagRComments*         = tagRMsgText + comments;
  316.   tagROrganization*     = tagRMsgText + organization;
  317.   tagRDistribution*     = tagRMsgText + distribution;
  318.   tagRFolder*           = tagRMsgText + folder;
  319.   tagRFidoID*           = tagRMsgText + fidoID;
  320.   tagRMausID*           = tagRMsgText + mausID;
  321.   tagRReplyGroup*       = tagRMsgText + replyGroup;
  322.   tagRReplyName*        = tagRMsgText + replyName;
  323.   tagRReplyAddr*        = tagRMsgText + replyAddr;
  324.   tagRLogicalToName*    = tagRMsgText + logicalToName;
  325.   tagRLogicalToAddr*    = tagRMsgText + logicalToAddr;
  326.   tagRFileName*         = tagRMsgText + fileName;
  327.   tagRRFCMsgNum*        = tagRMsgText + rfcMsgNum;
  328.  
  329.   tagRFidoText*         = tagRMsgText + fidoText;
  330.   tagRErrorText*        = tagRMsgText + errorText;
  331.   tagRNewsreader*       = tagRMsgText + newsreader;
  332.  
  333.   tagRRfcAttr*          = tagRMsgText + rfcAttr;
  334.   tagRFtnAttr*          = tagRMsgText + ftnAttr;
  335.   tagRZerAttr*          = tagRMsgText + zerAttr;
  336.   tagRMausAttr*         = tagRMsgText + mausAttr;
  337.  
  338.   tagRTempFileName*     = tagRMsgText + tempFileName;
  339.  
  340.   tagRMsgInfo*          = 512 + Utility.user;
  341.                                 (* datatype: POINTER TO MessageInfo (excludes cDate) *)
  342.   tagRTextFields*       = tagRMsgInfo + 1;
  343.                                 (* datatype: POINTER TO MsgTextFields *)
  344.  
  345.   tagRReadHeader*       = tagRMsgInfo + 2;
  346.                                 (* read all header-fields *)
  347.   tagRReadAll*          = tagRMsgInfo + 3;
  348.                                 (* read all text-fields *)
  349.   tagRExtMsgInfo*       = tagRMsgInfo + 4;
  350.                                 (* datatype: POINTER TO MessageInfo *)
  351.  
  352.   tagRNextFileName     - = 600 + Utility.user;
  353.   tagRNextTempFileName - = 601 + Utility.user;
  354.  
  355.   (** tags for Select()*  *)
  356.  
  357.   tagSelSet*            = 1024 + Utility.user;
  358.                                 (* flags to set on selected msgs *)
  359.   tagSelUnset*          = tagSelSet + 1;
  360.                                 (* flags to clear *)
  361.   tagSelWriteGlobal*    = tagSelSet + 2;
  362.                                 (* change global flags, not user-flags *)
  363.   tagSelWriteLocal*     = tagSelSet + 3;
  364.                                 (* change login-local flags, not user-flags *)
  365.   tagSelWriteUser*      = tagSelSet + 4 + typeSTRPTR;
  366.                                 (* change other user's flags *)
  367.  
  368.   tagSelStart*        = tagSelSet + 8;
  369.                 (* first msg to process *)
  370.   tagSelStop*        = tagSelSet + 9;
  371.                 (* msg to processing before  *)
  372.  
  373.   (* the following are mutual-exclusiv *)
  374.   (*   use only one of the following operations,   *)
  375.   (*   otherwise unpredictable things may happen!  *)
  376.  
  377.   tagSelReadGlobal*     = tagSelSet + 10;
  378.                                 (* examine global flags, not user-flags *)
  379.   tagSelReadLocal*      = tagSelSet + 11;
  380.                                 (* examine login-local flags, not user-flags *)
  381.   tagSelReadUser*       = tagSelSet + 12 + typeSTRPTR;
  382.                                 (* examine other user's flags *)
  383.   tagSelMask*           = tagSelSet + 16;
  384.                                 (* select msgs, that's flags    *)
  385.   tagSelMatch*          = tagSelSet + 17;
  386.                                 (*   ANDed with mask equal match *)
  387.   tagSelParent*         = tagSelSet + 18;
  388.                                 (* examine parent's flags *)
  389.  
  390.   tagSelDate*           = tagSelSet + 19;
  391.                                 (* select msgs younger than this date *)
  392.  
  393.   tagSelTree*           = tagSelSet + 20;
  394.                                 (* select whole tree this msg is in *)
  395.  
  396.   tagSelSubTree*        = tagSelSet + 21;
  397.                                 (* select sub-tree this msg is root of *)
  398.  
  399.   tagSelMsg*            = tagSelSet + 22;
  400.                                 (* select a msg specified by number *)
  401.  
  402.   tagSelQuick*          = tagSelSet + 23;
  403.                                 (* quick select enabled *)
  404.  
  405.   tagSelLink*           = tagSelSet + 24;
  406.                                  (* 0 don't select links *)
  407.                                  (* 1 also select hard links *)
  408.  
  409.   tagSelCDate*          = tagSelSet + 25;
  410.                                  (* select msgs younger than this cDate *)
  411.  
  412.   tagSelSize*           = tagSelSet + 26;
  413.                                  (* select msgs with more bytes *)
  414.  
  415.   (* more modifiers for status-selects *)
  416.  
  417.   tagSelMaxCount*       = tagSelSet + 27;
  418.                                  (* select at most N msgs *)
  419.                                  (* (backwards)           *)
  420.   tagSelMaxSize*       = tagSelSet + 28;
  421.                                  (* sum up msgs' sizes and stop    *)
  422.                                  (* before the sum exceeds N bytes *)
  423.                                  (* (backwards)                    *)
  424.  
  425.  
  426.   (** tags for Search()* *)
  427.  
  428.   tagSearchLast*        = 2048 + Utility.user;
  429.                                 (* number of LAST msg not to search *)
  430.   tagSearchQuick*       = tagSearchLast + 1;
  431.                                 (* quick searches enabled *)
  432.  
  433.   tagSearchGlobal*      = tagSearchLast + 2;
  434.                                 (* examine global flags instead of user-flags*)
  435.   tagSearchLocal*       = tagSearchLast + 3;
  436.                                 (* examine login-local flags, not user-flags *)
  437.   tagSearchUser*        = tagSearchLast + 4 + typeSTRPTR;
  438.                                 (* examine other user's flags *)
  439.   tagSearchDirection*   = tagSearchLast + 5;
  440.                                 (* set search direction *)
  441.                                 (*  0 = default  *)
  442.                                 (*  1 = forward  *)
  443.                                 (* -1 = backward *)
  444.   tagSearchPattern*     = tagSearchLast + 6;
  445.                                 (* string in tagMsgText .. tagMsgText+127 is: *)
  446.                                 (* 0: no pattern, just a plain string    *)
  447.                                 (* 1: an AmigaDOS style pattern          *)
  448.                                 (* 2: a pattern, only if it contains     *)
  449.                                 (*    wildcards ('auto-detect patterns') *)
  450.  
  451.   tagSearchMask*        = tagSearchLast + 16;
  452.                                 (* search a msg, that's flags   *)
  453.   tagSearchMatch*       = tagSearchLast + 17;
  454.                                 (*   ANDed with mask equal match *)
  455.  
  456.  
  457.   (**  tags for ReadConfig(), WriteConfig()*  *)
  458.  
  459.   tagCfgGlobalOnly*     = 3072 + Utility.user;
  460.                                 (* read or write only global config,         *)
  461.                                 (* thus must not be combined with tagCfgUser *)
  462.   tagCfgName*           = tagCfgGlobalOnly + 1 + typeSTRPTR;
  463.                                 (* name of config var to read or write       *)
  464.   tagCfgUser*           = tagCfgGlobalOnly + 2 + typeSTRPTR;
  465.                                 (* name of user to read/write locals from/to *)
  466.  
  467.   (**  tags for ReadConfig()*  *)
  468.  
  469.   tagCfgUserName*           = tagCfgGlobalOnly + 3 + typeSTRPTR;
  470.                                (* alias to get realname from                *)
  471.   tagCfgNextVar*            = tagCfgGlobalOnly + 4 + typeSTRPTR;
  472.                                (* get name of next var                      *)
  473.   tagCfgNextAlias*          = tagCfgGlobalOnly + 5 + typeSTRPTR;
  474.                                (* get name of next alias                    *)
  475.   tagCfgNextUser*           = tagCfgGlobalOnly + 6 + typeSTRPTR;
  476.                                (* get name of next user                     *)
  477.   tagCfgNextExporter*       = tagCfgGlobalOnly + 7 + typeSTRPTR;
  478.                                (* get name of next exporter                 *)
  479.   tagCfgNextNetGroup*       = tagCfgGlobalOnly + 8 + typeSTRPTR;
  480.                                (* get name of next netgroup                 *)
  481.   tagCfgNextNetGroupMember* = tagCfgGlobalOnly + 9 + typeSTRPTR;
  482.                                (* get name of next groupmember              *)
  483.   tagCfgLockVar*            = tagCfgGlobalOnly +10;
  484.                                (* 0: no locking                             *)
  485.                                (* 1: lock and read config var               *)
  486.  
  487.   (**  tags for ReadConfig(), WriteConfig()  **)
  488.  
  489.   tagCfgQuoted*             = tagCfgGlobalOnly +11;
  490.                                (* 0: no quoting                             *)
  491.                                (* 1: read/write var in quoted format        *)
  492.                                (*    (as used in "ums.config")              *)
  493.  
  494.   (**  tags for WriteConfig()*  *)
  495.  
  496.   tagCfgDump*           = tagCfgGlobalOnly + 16 + typeSTRPTR;
  497.                                 (* write current settings to a file *)
  498.   tagCfgData*           = tagCfgGlobalOnly + 17 + typeSTRPTR;
  499.                                 (* data to write to specified var   *)
  500.   tagCfgCreateUser*     = tagCfgGlobalOnly + 18 + typeSTRPTR;
  501.                                 (* create a new user                *)
  502.   tagCfgDeleteUser*     = tagCfgGlobalOnly + 19 + typeSTRPTR;
  503.                                 (* delete a user                    *)
  504.   tagCfgCreateAlias*    = tagCfgGlobalOnly + 20 + typeSTRPTR;
  505.                                 (* add an alias to a user           *)
  506.   tagCfgDeleteAlias*    = tagCfgGlobalOnly + 21 + typeSTRPTR;
  507.                                 (* delete an alias                  *)
  508.   tagCfgNetGroup*       = tagCfgGlobalOnly + 22 + typeSTRPTR;
  509.   tagCfgAddNetGroup*    = tagCfgGlobalOnly + 23 + typeSTRPTR;
  510.                                 (* create/add netgroups             *)
  511.   tagCfgDeleteNetGroup* = tagCfgGlobalOnly + 24 + typeSTRPTR;
  512.                                 (* delete a new netgroup            *)
  513.   tagCfgUnlockVar*      = tagCfgGlobalOnly + 25;
  514.                                 (* 0: no locking                    *)
  515.                                 (* 1: unlock and write config var   *)
  516.                                 (* 2: unlock but don't write        *)
  517.   tagCfgLocal*          = tagCfgGlobalOnly + 26;
  518.                                 (* create/delete login-local variable *)
  519.   tagCfgCreateSysop*    = tagCfgGlobalOnly + 27 + typeSTRPTR;
  520.                                 (* create a new sysop               *)
  521.   tagCfgCreateExporter* = tagCfgGlobalOnly + 28 + typeSTRPTR;
  522.                                 (* create a new exporter            *)
  523.  
  524.   (**  tags for MatchConfig()  **)
  525.  
  526.   tagMatchGlobalOnly *    = 4096 + Utility.user;
  527.   tagMatchVarname *    = tagMatchGlobalOnly+ 1 + typeSTRPTR;
  528.   tagMatchUser *    = tagMatchGlobalOnly+ 2 + typeSTRPTR;
  529.   tagMatchString *    = tagMatchGlobalOnly+ 3 + typeSTRPTR;
  530.   tagMatchDefault *    = tagMatchGlobalOnly+ 4;
  531.  
  532.  
  533.   (***  functions ***)
  534.  
  535. PROCEDURE Login*           {base, -30} (user{2}    : ARRAY OF CHAR;
  536.                                         passwd{3}  : ARRAY OF CHAR): Account;
  537.  
  538. PROCEDURE Logout*          {base, -36} (account{2}: Account);
  539.  
  540. PROCEDURE ErrNum*          {base,-120} (account{2}: Account): Error;
  541.  
  542. PROCEDURE ErrTxt*          {base,-126} (account{2}: Account): STRPTR;
  543.  
  544. PROCEDURE DeleteMsg*       {base,-132} (account{2}: Account;
  545.                                         MsgNum{3} : MsgNum): BOOLEAN;
  546.  
  547. (*** V9:** *)
  548.  
  549. PROCEDURE ExportedMsg*     {base,-234} (acc{2}: Account;
  550.                                         num{3}: MsgNum);
  551.  
  552. PROCEDURE CannotExport*    {base,-240} (acc{2}  : Account;
  553.                                         num{3}  : MsgNum;
  554.                                         error{4}: ARRAY OF CHAR): BOOLEAN;
  555.  
  556. PROCEDURE VLog*            {base,-246} (acc{2}   : Account;
  557.                                         level{4} : LONGINT;
  558.                                         format{5}: ARRAY OF CHAR;
  559.                                         args{6}  : ARRAY OF SYSTEM.BYTE);
  560. PROCEDURE Log*             {base,-246} (acc{2}   : Account;
  561.                                         level{4} : LONGINT;
  562.                                         format{5}: ARRAY OF CHAR;
  563.                                         args{6}..: SYSTEM.ADDRESS);
  564.  
  565. PROCEDURE RLogin*          {base,-252} (server{2}: ARRAY OF CHAR;
  566.                                         user{3}  : ARRAY OF CHAR;
  567.                                         passwd{4}: ARRAY OF CHAR): Account;
  568.  
  569. PROCEDURE WriteMsg*        {base,-258} (acc{2}     : Account;
  570.                                         tagItems{3}: ARRAY OF Utility.TagItem): MsgNum;
  571. PROCEDURE WriteMsgTags*    {base,-258} (acc{2}       : Account;
  572.                                         tagItems{3}..: Utility.Tag): MsgNum;
  573.  
  574. PROCEDURE ReadMsg*         {base,-264} (acc{2}     : Account;
  575.                                         tagItems{3}: ARRAY OF Utility.TagItem): BOOLEAN;
  576. PROCEDURE ReadMsgTags*     {base,-264} (acc{2}       : Account;
  577.                                         tagItems{3}..: Utility.Tag): BOOLEAN;
  578.  
  579. PROCEDURE FreeMsg*         {base,-270} (acc{2}   : Account;
  580.                                         msgNum{3}: MsgNum);
  581.  
  582. PROCEDURE Select*          {base,-276} (acc{2}     : Account;
  583.                                         tagItems{3}: ARRAY OF Utility.TagItem): LONGINT;
  584. PROCEDURE SelectTags*      {base,-276} (acc{2}       : Account;
  585.                                         tagItems{3}..: Utility.Tag): LONGINT;
  586.  
  587. PROCEDURE Search*          {base,-282} (acc{2}     : Account;
  588.                                         tagItems{3}: ARRAY OF Utility.TagItem): MsgNum;
  589. PROCEDURE SearchTags*      {base,-282} (acc{2}       : Account;
  590.                                         tagItems{3}..: Utility.Tag): MsgNum;
  591.  
  592. PROCEDURE ReadConfig*      {base,-288} (acc{2}     : Account;
  593.                                         tagItems{3}: ARRAY OF Utility.TagItem): STRPTR;
  594. PROCEDURE ReadConfigTags*  {base,-288} (acc{2}       : Account;
  595.                                         tagItems{3}..: Utility.Tag): STRPTR;
  596.  
  597. PROCEDURE FreeConfig*      {base,-294} (acc{2}: Account;
  598.                                         str{3}: STRPTR);
  599.  
  600. PROCEDURE WriteConfig*     {base,-300} (acc{2}     : Account;
  601.                                         tagItems{3}: ARRAY OF Utility.TagItem): BOOLEAN;
  602. PROCEDURE WriteConfigTags* {base,-300} (acc{2}       : Account;
  603.                                         tagItems{3}..: Utility.Tag): BOOLEAN;
  604.  
  605. (* V11 *)
  606.  
  607. PROCEDURE ServerControl*   {base,-312} (server{2}: ARRAY OF CHAR;
  608.                                         action{3}: LONGINT): Error;
  609.  
  610. PROCEDURE MatchConfig*     {base,-318} (acc{2}     : Account;
  611.                                         tagItems{3}: ARRAY OF Utility.TagItem): BOOLEAN;
  612. PROCEDURE MatchConfigTags* {base,-318} (acc{2}       : Account;
  613.                                         tagItems{3}..: Utility.Tag): BOOLEAN;
  614.  
  615. PROCEDURE ErrTxtFromNum*   {base,-324} (err{2}: Error): STRPTR;
  616.  
  617. PROCEDURE DupAccount*      {base,-330} (acc{2}: Account): Account;
  618.  
  619. BEGIN
  620.   base := Exec.OpenLibrary (libName, libVersion);
  621.   IF base = NIL THEN
  622.     Alert.Request ("", "missing ums.library");
  623.     HALT (Dos.fail)
  624.   END
  625.  
  626. CLOSE
  627.   IF base # NIL THEN Exec.CloseLibrary (base); base := NIL END;
  628. END ums.
  629.